// (c) Copyright 2013-2014 Stephen Gold <sgold@sonic.net>
// Distributed under the terms of the GNU General Public License

/*
 This file is part of the Bats Game.

 The Bats Game is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by the
 Free Software Foundation, either version 3 of the License, or (at your
 option) any later version.

 The Bats Game is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.

 You should have received a copy of the GNU General Public License
 along with the Bats Game.  If not, see <http://www.gnu.org/licenses/>.
 */
package bats;

import bats.control.BatsControl;
import jme3utilities.debug.Printer;

/**
 * Scene graph printer extended for the Bats Game.
 * <p>
 * printSubtree() is the usual interface to this class.
 *
 * @author Stephen Gold <sgold@sonic.net>
 */
public class BatsPrinter
        extends Printer {
    // *************************************************************************
    // constructors

    /**
     * Instantiate a scene-graph printer.
     */
    public BatsPrinter() {
        /*
         * Set printer options.
         */
        setPrintTransform(true);
    }
    // *************************************************************************
    // Printer methods

    /**
     * Test whether a scene-graph control is enabled.
     *
     * @param control which control to test (not null)
     * @return true if the control is enabled, otherwise false
     */
    @Override
    protected boolean isControlEnabled(Object control) {
        assert control != null;

        boolean result = BatsControl.isEnabled(control);
        return result;
    }
}